package cn.iocoder.yudao.module.crossborder.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 跨境电商配送状态枚举
 *
 * @author LHL
 */
@AllArgsConstructor
@Getter
public enum DeliveryStatusEnum {

    PENDING_SHIP(10, "待发货"),
    SHIPPED(20, "已发货"),
    IN_TRANSIT(30, "运输中"),
    OUT_FOR_DELIVERY(40, "派送中"),
    DELIVERED(50, "已送达"),
    DELIVERY_FAILED(60, "配送失败"),
    RETURNED(70, "已退回"),
    ;

    /**
     * 状态值
     */
    private final Integer status;
    
    /**
     * 状态名称
     */
    private final String name;

    public static DeliveryStatusEnum getByStatus(Integer status) {
        for (DeliveryStatusEnum value : values()) {
            if (value.getStatus().equals(status)) {
                return value;
            }
        }
        return null;
    }

}
